var _util = require('util/util.js');

var _account_service = {
    checkLogin : function(resolve, reject){
        _util.request({
            url     : _util.getServerURL('account/getAccountInfo'),
            method  : 'POST',
            success : resolve,
            error   : reject
        });
    },
    login : function(account, resolve, reject){
        _util.request({
            url     : _util.getServerURL('account/login'),
            data    : account,
            method  : 'POST',
            success : resolve,
            error   : reject
        });
    },
    logout : function( resolve, reject){
        _util.request({
            url     : _util.getServerURL('account/logout'),
            method  : 'POST',
            success : resolve,
            error   : reject
        });
    }
};

module.exports = _account_service;